package cn.daniel.goods.client;

import cn.daniel.commonutils.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-vod",fallback = RemoteVideoCallClient.class)
@Component
public interface VodClient {
    /**
     *定义远程模块方法的路径调用，根据视频id删除视频
     * @PathVariable 一定要指定参数名称，否则可能出错
     * @param id
     * @return Response
     */
    @DeleteMapping("/service/video/removeVideoById/{id}")
    public Response removeVideoById(@PathVariable("id") String id);

    /**
     * 定义远程模块方法的路径调用，删除多个视频
     * @param videoIdList  多个视频id
     * @return Response
     */
    @DeleteMapping("/service/video/deleteBatchVideo")
    public Response deleteBatchVideo(@RequestParam("videoIdList") List<String> videoIdList);


    /**
     * 获取上传的视频信息
     * @param videoId
     * @return
     */
    @GetMapping("/service/video/getVideoInfo/{videoId}")
    public Response getVideoInfo(@PathVariable("videoId") String videoId);


}
